<template>
  <div>
    <div class="top">
      <div class="left">
        <img
          style="border-radius: 3px"
          src="https://ossweb-img.qq.com/upload/webplat/info/yxzj/20220224/1237542471740.jpg"
          alt=""
        />
      </div>
      <ul>
        <li v-for="(v, i) in top" :key="v.iId">
          <span v-if="i != 0" class="title">{{ title }}</span>
          <span class="stitle">{{ v.sTitle }}</span>
          <div v-if="i == 0" class="sdesc">{{ v.sDesc }}</div>
          <span v-if="i != 0" class="time">{{ time(v.sIdxTime) }}</span>
        </li>
      </ul>
    </div>
    <div class="bottom">
      <div v-for="v in bottom" :key="v.iId" :title="v.sTitle" style="padding: 0 4px;">
        <div>
          <img :src="v.sIMG" alt="" />
        </div>
        <div>{{ v.sTitle }}</div>
        <div style="width: 204px;margin-left: 4px;">
          <img
            src="/img/u=30380529,3879027376&fm=253&fmt=auto&app=138&f=JPEG.webp"
            alt=""
          />
        </div>
        <div style="width: 204px;margin-left: 4px;">
          <div>{{ v.iTotalPlay }}</div>
          <div>{{ v.sIdxTime.split(" ")[0] }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    time(t) {
      return (
        t.split(" ")[0].split("-")[1] + "-" + t.split(" ")[0].split("-")[2]
      );
    },
  },
  props: ["top", "bottom", "title"],
  mounted() {
    console.log(this.top, 111111);
    console.log(this.bottom, 222222);
  },
};
</script>

<style lang="scss" scoped>
.top {
  background-color: #fff;
  margin-top: 20px;
  display: flex;
  ul {
    width: 660px;
    padding-left: 15px;
    li {
      cursor: pointer;
      //   border: 1px solid red;
      margin-bottom: 12px;
      &:first-child {
        .stitle {
          font-size: 24px;
        }
        .sdesc {
          width: 450px;
          // border: 1px solid blue;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
          color: gray;
          font-size: 14px;
        }
      }
      &:not(:first-child) {
        // padding: 6px 0;
        // line-height: 40px;

        .stitle {
          font-size: 14px;
        }
        .title {
          margin-top: 20px !important;
          background-color: rgb(227, 227, 227);
          margin-right: 15px;
          color: gray;
          padding: 1px 18px;
          border-radius: 20px;
        }
        .time {
          color: gray;
          float: right;
        }
      }
    }
  }
}
.bottom {
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  img {
    border-radius: 3px;
  }
  > div {
    cursor: pointer;
    position: relative;
    width: 212px;
    height: 175px;
    // border: 1px solid red;
    margin-bottom: 30px;
    &:hover > div:nth-child(3) {
      z-index: 1;
    }
    > div:nth-child(3) {
      text-align: center;
      position: absolute;
      left: 0;
      right: 0;
      background-color: rgba(0, 0, 0, 0.452);
      top: 0;
      height: 125px;
      padding-top: 40px;
      z-index: -1;
      img {
        width: 40px;
        height: 40px;
        border-radius: 50%;
      }
    }
    &:not(:nth-child(4), :nth-child(8)) {
      margin-right: 7px;
    }
    > div:first-child {
      height: 125px;
      img {
        width: 100%;
        height: 100%;
      }
    }
    > div:nth-child(2) {
      padding-top: 10px;
      font-size: 14px;
    }
    > div:last-child {
      position: absolute;
      top: 103px;
      left: 0;
      right: 0;
      display: flex;
      justify-content: space-between;
      //   border: 1px solid red;
      padding: 3px 8px;
      color: white;
      font-size: 12px;
      background-color: rgba(0, 0, 0, 0.516);
      > div:first-child {
        padding-left: 15px;
        background-image: url("/public/img/index.png");
        background-position: -256px -62px;
      }
    }
  }
}
</style>